package com.abcdefg.rabbitmq.listener;

import com.abcdefg.rabbitmq.constant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DirectConsumerLister {
    @RabbitListener(queues = Constants.DIRECT_QUEUE1)
    public void lister1(String message){
        System.out.println("lister 1 ["+Constants.DIRECT_QUEUE1+"],接收到的消息："+message);
    }
    @RabbitListener(queues = Constants.DIRECT_QUEUE2)
    public void lister2(String  message){
        System.out.println("lister 2 ["+Constants.DIRECT_QUEUE2+"],接收到的消息："+message);
    }
}
